% TEST_ID: LANG-EXPAND-0033
% CATEGORY: language/array-ops/ops
% 测试 .^ 运算符

function test_pow
    A = [1, 2; 3, 4];
    C = A .^ 2;
    assert_isclose(C, [1 4; 9 16]);

    A = [1, 2; 3, 4];
    C = A .^ -1;
    assert_isclose(C, [1 1/2 ; 1/3 1/4]);
end

function assert_isclose(x, y)
    assert(all(abs(x - y) < 1e-14))
end
